﻿using System.Windows;
using Honest.MES.Contracts.Interfaces;
using Honest.MES.WPF.Constants;
using Prism.Navigation.Regions;

namespace Honest.MES.WPF.Services
{
    public class ShellService : IShellService
    {
        private readonly IRegionManager _regionManager;
        private readonly Window _shell;

        public ShellService(IRegionManager regionManager, Window shell)
        {
            _regionManager = regionManager;
            _shell = shell;
        }

        public void Initialize()
        {
            NavigateToDefaultView();
        }

        public void Show()
        {
            _shell.Show();
        }

        public void Close()
        {
            _shell.Close();
        }

        private void NavigateToDefaultView()
        {
            _regionManager.RequestNavigate(RegionNames.MainRegion, "DefaultView");
        }
    }
}